import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/home.vue';
import Login from '../views/login/login.vue';
import Register from '../views/register/register.vue';
const StudentsAdd = ()=> import('../views/home/students/studentsAdd.vue');//-----------------------------新增学生信息懒加载----------------------------
const StudentsList = ()=> import('../views/home/students/studentsList.vue');//---------------------------学生信息列表懒加载----------------------------
const StudentsUpdate = ()=> import('../views/home/students/studentsUpdate.vue');//-----------------------修改学生信息懒加载----------------------------
const ClassesList = ()=> import('../views/home/classes/classesList.vue');//------------------------------班级信息懒加载----------------------------
const ClassesAdd = ()=> import('../views/home/classes/classesAdd.vue');//--------------------------------新增班级懒加载----------------------------
const SubjectsList = () => import('../views/home/subjects/subjectsList.vue')//---------------------------专业信息列表懒加载---------------------------
const SubjectsAdd = () => import('../views/home/subjects/subjectsAdd.vue')//-----------------------------新增专业信息懒加载---------------------------
const TeacherAdd = () => import('../views/home/teachers/teacherAdd.vue')//-------------------------------新增教师信息懒加载---------------------------
const TeachersList = () => import('../views/home/teachers/teachersList.vue')//---------------------------教师信息数据懒加载---------------------------
const DirectorsList = () => import('../views/home/directors/directorsList.vue') //-----------------------班主任信息数据懒加载


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login',
    
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      //---------------------------------新增学生信息----------------------------------------
      {
        path: 'studentsAdd',
        name: 'StudentsAdd',
        component: StudentsAdd,
      },
      //---------------------------------学生信息列表----------------------------------------
      {
        path: 'studentsList',
        name: 'StudentsList',
        component: StudentsList,
      },
      //---------------------------------学生信息修改----------------------------------------
      {
        path: 'studentsUpdate/:_id',
        name: 'StudentsUpdate',
        props:true,
        component: StudentsUpdate,
      },
      //---------------------------------班级信息列表----------------------------------------
      {
        path: 'classesList',
        name: 'ClassesList',
        component: ClassesList,
      },
      //---------------------------------新增班级信息----------------------------------------
      {
        path: 'classesAdd',
        name: 'ClassesAdd',
        component: ClassesAdd,
      },
       //---------------------------------专业信息列表----------------------------------------
       {
        path: 'subjectsList',
        name: 'SubjectsList',
        component: SubjectsList,
      },
       //---------------------------------新增专业信息----------------------------------------
       {
        path: 'subjectsAdd',
        name: 'SubjectsAdd',
        component: SubjectsAdd,
      },
      //---------------------------------教师信息列表----------------------------------------
      {
        path: 'teachersList',
        name: 'TeachersList',
        component: TeachersList,
      },
       //---------------------------------新增教师信息----------------------------------------
       {
        path: 'teacherAdd',
        name: 'TeacherAdd',
        component: TeacherAdd,
      },
      //---------------------------------班主任信息列表----------------------------------------
      {
        path: 'directorsList',
        name: 'DirectorsList',
        component: DirectorsList,
      },
    ]

  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
    
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },
]

const router = new VueRouter({
  routes
})

export default router
